#将数据对象封装到对象接口，在方法中对原始数据进行加工处理
# user_list=["用户-{}".format(i) for i in range(1,3000)]
#分页显示，每页现实10条
# while True:
#     page =int (input("请输入页码："))
#
#     start_index = (page-1)*10
#     end_index = page*10
#     page_data_list=user_list[start_index:end_index]
#
#     for item in page_data_list:
#         print(item)


user_list=["用户-{}".format(i) for i in range(1,3000)]
#用面向对象来进行处理
class pagination:
    def __init__(self,current_page,per_page_num=10):
        self.per_page_num=per_page_num
        if not current_page.isdecimal():
            self.current_page=1
            return
        #current_page = int(current_page)
        if int(current_page)<1:
            self.current_page=1
            return
        self.current_page=int(current_page)

    def start(self):
        return (self.current_page-1)*self.per_page_num

    def end(self):
        return self.current_page*self.per_page_num



#分页显示，每页显示条
while True:
    page=input("请输入页码：")
    pg_object=pagination(page,10)
    page_data_list=user_list[pg_object.start():pg_object.end()]
    for i in page_data_list:
        print(i)